using System;
using System.Runtime.Remoting;
using System.Runtime.Serialization;

namespace Credit.Objects{
	/// <summary>
	/// Error that comes from credit agency.
	/// </summary>
	[Serializable]
	public class CreditInquiryException : RemotingException,ISerializable{

		private string message;

		public CreditInquiryException(string htmlFromAgency){
			message = htmlFromAgency;
		}

		public CreditInquiryException(SerializationInfo info, StreamingContext context){
			message = (string)info.GetValue("message", typeof(string));
		}

		public override void GetObjectData(SerializationInfo info, StreamingContext context){
			info.AddValue("message", message);
		}

		// Returns the exception information. 
		public override string Message{get {return message;}}

	}
}
